-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TAS-1217] 🚸 Add default value to stakeholders #440
[TAS-1217] 🚸 Add default value to stakeholders #440
Conversation
AuroraHuang22
commented
Feb 15, 2024
components/IscnRegisterForm.vue
Outdated
const { data } = await this.$axios.get( | ||
getUserInfoMinByAddress(this.address), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this throw 404 error, skipping the whole iscnOwner
block if the address does not have likeId?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also we can consider using catchAxiosError
, but I think even non-404 error should be caught in this case
components/IscnRegisterForm.vue
Outdated
try { | ||
const { data } = await this.$axios.get(getUserInfoMinByAddress(address)) | ||
return { | ||
name: data?.displayName || address, | ||
wallet: [{ content: address, id: 1, type: 'like', isOpenOptions: false }], | ||
url: [], | ||
likerId: data?.user || '', | ||
authorDescription: data?.description || 'Publisher', | ||
} | ||
} catch (error) { | ||
// eslint-disable-next-line no-console | ||
console.error(error) | ||
return { | ||
name: address, | ||
wallet: [{ content: address, id: 1, type: 'like', isOpenOptions: false }], | ||
url: [], | ||
likerId: '', | ||
authorDescription: 'Publisher', | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try { | |
const { data } = await this.$axios.get(getUserInfoMinByAddress(address)) | |
return { | |
name: data?.displayName || address, | |
wallet: [{ content: address, id: 1, type: 'like', isOpenOptions: false }], | |
url: [], | |
likerId: data?.user || '', | |
authorDescription: data?.description || 'Publisher', | |
} | |
} catch (error) { | |
// eslint-disable-next-line no-console | |
console.error(error) | |
return { | |
name: address, | |
wallet: [{ content: address, id: 1, type: 'like', isOpenOptions: false }], | |
url: [], | |
likerId: '', | |
authorDescription: 'Publisher', | |
} | |
} | |
let userData: any = null; | |
try { | |
({ data: userData } = await this.$axios.get(getUserInfoMinByAddress(address))) | |
} catch (error) { | |
// eslint-disable-next-line no-console | |
console.error(error) | |
} | |
return { | |
name: userData?.displayName || address, | |
wallet: [{ content: address, id: 1, type: 'like', isOpenOptions: false }], | |
url: [], | |
likerId: userData?.user || '', | |
authorDescription: userData?.description || 'Publisher', | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.